import QtQuick 2.0
import "./Components"
Rectangle{
    x:200
    y:50
    width: 200
    height: 480
    color: "linen"
    TextInput{
        id:input1
        x:parent.x+10
        y:parent.y+10
        width: 96
        height: 20
        focus: true
        text: "Text Input 1"
        KeyNavigation.tab: input2 //设置按tab键切换到哪个控件
        anchors.bottom: input2.top
        anchors.margins: 8
    }
    TextInput{
        id:input2
        x:parent.x+10
        y:parent.y+30
        width: 96
        height: 20
        text: "Text Input 2"
        KeyNavigation.tab: input1
        anchors.bottom: input3.top
        anchors.margins: 8
    }
    TLineEditV1{
        x:parent.x+10
        y:parent.y+60
        id:input3
        input_text: "Text Input 3"
        anchors.top: input2.bottom
        anchors.bottom: input4.top
        anchors.margins: 8
    }
    TLineEditV1{
        x:parent.x+10
        y:parent.y+100
        id:input4
        input_text: "Text Input 4"
        anchors.top: input3.bottom
        anchors.bottom: input5.top
        anchors.margins: 8
    }

    TLineEditV2{
        x:parent.x+10
        y:parent.y+140
        id:input5
        text: "Text Input 5"
        anchors.top: input4.bottom
        anchors.bottom: input6.top
        anchors.margins: 8
    }
    TLineEditV2{
        x:parent.x+10
        y:parent.y+180
        id:input6
        text: "Text Input 6"
        anchors.top: input5.bottom
        anchors.bottom: input7.top
        anchors.margins: 8
    }
    TTextEdit{
        x:parent.x+10
        y:parent.y+220
        id:input7
        text: "Text Input 6"
    }
    DarkSquare{
        id:square_root
        width: 400
        height: 200
        x:parent.x+400
        y:parent.y+200
        GreenSquare{
            id:square
            width: 40
            height: 30
           // anchors.fill: parent
        }
        focus: true
        Keys.onLeftPressed: square.x-=8
        Keys.onRightPressed: square.x+=8
        Keys.onUpPressed: square.y-=8
        Keys.onDownPressed: square.y+=8
        Keys.onPressed: {
            switch(event.key){
            case Qt.Key_Plus:
                square.scale+=0.2
                break;
            case Qt.Key_Minus:
                square.scale-=0.2
                break;
            }
        }
    }
}
